﻿using Coldairarrow.Util;
using Furion;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Admin.Core
{
    /// <summary>
    /// 权限表
    /// </summary>
    [SugarTable("Base_Security")]
    public partial class BaseSecurity : SugarEntity<string>
    {
        public BaseSecurity()
        {
            Id = IdHelper.GetId();
            ParentId = null;
            CreatorId = App.User.FindFirst("UserId")?.Value;
            CreatedTime = DateTime.Now;
            IsDeleted = false;
            IsEnabled = false;
            IsVisible = true;
            IsFrame = false;
            NeedAction = true;
        }

        /// <summary>
        /// 父级Id
        /// </summary>
        public String ParentId { get; set; }
        /// <summary>
        /// 图标
        /// </summary>
        public String MenuIcon { get; set; }
        /// <summary>
        /// 链接地址(组件)
        /// </summary>
        public String Component { get; set; }
        /// <summary>
        /// 权限名称
        /// </summary>
        public String MenuName { get; set; }
        /// <summary>
        /// 序号
        /// </summary>
        public int MenuSort { get; set; }
        /// <summary>
        /// 菜单分类
        /// </summary>
        public MenuType MenuType { get; set; }
        /// <summary>
        /// 权限标识
        /// </summary>
        public String Perms { get; set; }
        /// <summary>
        /// 备注信息
        /// </summary>
        public String Remark { get; set; }
        /// <summary>
        /// 是否需要权限(仅页面有效)
        /// </summary>
        public bool NeedAction { get; set; }
        /// <summary>
        /// 是否外链
        /// </summary>
        public bool IsFrame { get; set; }
        /// <summary>
        /// 是否显示
        /// </summary>
        public bool IsVisible { get; set; }
        /// <summary>
        /// 是否禁用
        /// </summary>
        public bool IsEnabled { get; set; }
    }
}
